home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Reference / the cmsp digests ('94-'97) / csmp digest Vol 4 No 019 < prev    next >
Encoding:
Text File  |  1996-11-18  |  60.5 KB  |  1,721 lines  |  [TEXT/R*ch]

  1. C.S.M.P. Digest             Sat, 09 Nov 96       Volume 4 : Issue 19
  2.  
  3. Today's Topics:
  4.  
  5.         3-D???
  6.         An other question about Mouse move
  7.         CopyBits performance = ü(window position)?
  8.         Disk swapping problem - floppy reading floppy
  9.         Documentation tool?
  10.         Drawing to MenuBar from SystemTask patch
  11.         FSpExchangeFiles example has a bug?
  12.         FSpExchangeFiles-"safe-save"
  13.         Finding memory leaks in applications using malloc, free, new, delete
  14.         Floating windows with Text Services (NewServiceWindow)
  15.         Flushing volumes from MacsBug
  16.         Ftnchek 2.9.4 as an MPW tool anyone?
  17.         GWorld problem
  18.         GWorlds:
  19.         Globals in PowerPC Assembly Code
  20.         How about INITs
  21.         How to Debug Drag & Drop ?
  22.         How to port Think Pascal 4.0 program to PPC 604e-180?
  23.         ICN# or ICON resource?
  24.         Interrupt level - What am i allowed to do?
  25.         Launch URL form FileMaker?
  26.         Looking for a diff program.
  27.         MacIntosh Toolbox, Def. of calls
  28.         Meaning of error -127 ?
  29.         Moving the mouse cursor!
  30.         NFS client for the Macintosh
  31.         Need program to create and customize installs for Mac
  32.         Of Sprites and GWorlds
  33.         Open Transport from MultiProcessor Task?
  34.         PBCatSearch problem
  35.         Periodic tasks w-o using VBL
  36.         QuickTime CDEF
  37.         Re-entrant problem?  Devices and WaitNextEvent?
  38.         Resource Compiler
  39.         Socket library for Macs???
  40.         Strange code generated (CW10)
  41.         TP and CW difference
  42.         Those windows with thin title bars
  43.         Tracking down stray pointers...???
  44.         Unlocking files in AppleScript
  45.         Visual Basic program -> Mac program
  46.         What do you guys use for an installer of your software?
  47.         [Q] Looping WAV files from memory.
  48.         [Q] PBRead and the disk driver...
  49.         [Q] SYNC PowerPC instruction not working in 604e ?
  50.         long date-time record questions
  51.         looking for Vantage text editor
  52.         simple CopyBits question:
  53.  
  54.  
  55.  
  56. The Comp.Sys.Mac.Programmer Digest is moderated by Mark Aiken
  57. (marka@ee.mcgill.ca).
  58.  
  59. The digest is a collection of article threads from the internet
  60. newsgroups comp.sys.mac.programmer.help, csmp.tools, csmp.misc and
  61. csmp.games. It is designed for people who read news semi-regularly and
  62. want an archive of the discussions.  If you don't know what a
  63. newsgroup is, you probably don't have access to it. Ask your systems
  64. administrator(s) for details. If you don't have access to news, you
  65. may still be able to post messages to the group by using a mail server
  66. like anon.penet.fi (mail help@anon.penet.fi for more information).
  67.  
  68. Each issue of the digest contains one or more sets of articles (called
  69. threads), with each set corresponding to a 'discussion' of a particular
  70. subject.  The articles are not edited; all articles included in this digest
  71. are in their original posted form (as received by our news server at
  72. ee.mcgill.ca).  Article threads are not added to the digest until the last
  73. article added to the thread is at least two weeks old (this is to ensure that
  74. the thread is dead before adding it to the digest).  Article threads that
  75. consist of only one message are generally not included in the digest.
  76.  
  77. The digests can be obtained by email, ftp or through the World Wide Web.
  78.  
  79. If you want to receive the digest by mail, send email to 
  80. majordomo@ee.mcgill.ca with no subject and one of the following commands
  81. as body:
  82.  
  83.     help                        Sends you a summary of commands
  84.     subscribe csmp                      Adds you to the mailing list
  85.     unsubscribe csmp                    Removes you from the list
  86.  
  87. Once you have subscribed, you will automatically receive each new
  88. issue as it is created.
  89.  
  90. Back issues are available by ftp from Info-Mac mirror sites in the
  91. per/csmp subdirectory, e.g.
  92.  
  93.   ftp://sumex-aim.stanford.edu/info-mac/per/csmp/
  94.  
  95. The contents of all back issues can be searched by accessing the
  96. following URL, courtesy of Andrew Barry (ajbarry@ozemail.com.au):
  97.  
  98.     http://marvin.stattech.com.au/search.html
  99.  
  100. They can also be searched through the following URLs, thanks to
  101. Tim Tuck (Tim.Tuck@sensei.com.au):
  102.  
  103.     http://wais.sensei.com.au/searchform.html
  104.     wais://wais.sensei.com.au:210/csmp?
  105.  
  106. -------------------------------------------------------
  107.  
  108. >From lalo7475@saintmarys.edu
  109. Subject: 3-D???
  110. Date: 24 Oct 1996 10:06:02 GMT
  111. Organization: Deja News Usenet Posting Service
  112.  
  113. I have a great 3-D game in mind and want to start making it.  I have
  114. made a couple of 2-D casino games and one shoot em up.   I was
  115. wondering if I have books on quickdraw 3-D and Tricks of Mac Games
  116. Gurus,  if I was ready to make the Jump straight into 3-D programming
  117. ?
  118. Or is there a lot of stuff to programming in 3-D that me, as a new
  119. programmer, am not ready for?
  120. I know this question is broad and vague, but I don't have anyone else
  121. to ask and I have such a good idea that I want to jump on it while
  122. it's hot.    If all I need are books,  then I can learn it, but
  123. does it take more than books?
  124. Thanks
  125. Frank La Lone
  126. - ---------------------------------------------------------------------
  127. This article was posted to Usenet via the Posting Service at Deja News:
  128. http://www.dejanews.com/          [Search, Post, and Read Usenet News!]
  129.  
  130. +++++++++++++++++++++++++++
  131.  
  132. >From g-kendall@nwu.edu (Brian Kendall)
  133. Date: Thu, 24 Oct 1996 18:41:11 -0400
  134. Organization: Programmer
  135.  
  136. In article <846148235.6748@dejanews.com>, lalo7475@saintmarys.edu wrote:
  137.  
  138. > I have a great 3-D game in mind and want to start making it.  I have
  139. > made a couple of 2-D casino games and one shoot em up.   I was
  140. > wondering if I have books on quickdraw 3-D and Tricks of Mac Games
  141. > Gurus,  if I was ready to make the Jump straight into 3-D programming
  142. > ?
  143. > Or is there a lot of stuff to programming in 3-D that me, as a new
  144. > programmer, am not ready for?
  145. > I know this question is broad and vague, but I don't have anyone else
  146. > to ask and I have such a good idea that I want to jump on it while
  147. > it's hot.    If all I need are books,  then I can learn it, but
  148. > does it take more than books?
  149. > Thanks
  150. > Frank La Lone
  151. > -----------------------------------------------------------------------
  152. > This article was posted to Usenet via the Posting Service at Deja News:
  153. > http://www.dejanews.com/          [Search, Post, and Read Usenet News!]
  154.  
  155. Wow. I want to make a cool 3d game, too.
  156. It's probably a good idea to use those two books you mentioned (if they
  157. are a big help, lemme know :). 3d things can be a little hard, though. It
  158. can be hard to get the perspective right. I want to make a polygon graphic
  159. game and I have to worry about z-buffering and speed. Since there is a lot
  160. of math and if-statements involved, it can be slowed down big time.
  161.  
  162. Someone suggested to me to just go and get some sort of package that has
  163. ready made 3d code in it that runs right and fast. It seems like a good
  164. idea (but where's the fun in that?)
  165.  
  166. As a final tip, I can only say one thing: don't think super duper 3d. A
  167. macintosh (even a powermac) has it's limits. You can't have a hundred
  168. really complex 3d objects moving around on the screen at a time unless you
  169. have the perfect 3d code. I've lost many a good idea by trying to make
  170. games that don't run fast enough.
  171.  
  172. Hope this helps.
  173.  
  174. Brian K.
  175.  
  176. ãããããããããããããããããããããããããããããããããããããããããããããããããããããããããããããããããã
  177. "If you take cranberries and stew them like apple sauce, it tastes
  178. much more like prunes then rhubarb does." ã Groucho Marx
  179. ãããããããããããããããããããããããããããããããããããããããããããããããããããããããããããããããããã
  180.  
  181. +++++++++++++++++++++++++++
  182.  
  183. >From David Matiskella <matiskel@aa.washington.edu>
  184. Date: Thu, 24 Oct 1996 10:57:50 -0700
  185. Organization: University of Washington
  186.  
  187. On 24 Oct 1996 lalo7475@saintmarys.edu wrote:
  188.  
  189. > I have a great 3-D game in mind and want to start making it.  I have
  190. > made a couple of 2-D casino games and one shoot em up.   I was
  191. > wondering if I have books on quickdraw 3-D and Tricks of Mac Games
  192. > Gurus,  if I was ready to make the Jump straight into 3-D programming
  193. > ?
  194. > Or is there a lot of stuff to programming in 3-D that me, as a new
  195. > programmer, am not ready for?
  196. > I know this question is broad and vague, but I don't have anyone else
  197. > to ask and I have such a good idea that I want to jump on it while
  198. > it's hot.    If all I need are books,  then I can learn it, but
  199. > does it take more than books?
  200. > Thanks
  201. > Frank La Lone
  202. > -----------------------------------------------------------------------
  203. > This article was posted to Usenet via the Posting Service at Deja News:
  204. > http://www.dejanews.com/          [Search, Post, and Read Usenet News!]
  205. YOu really should pick up a book on Computer graphics. There are basically
  206. two types. The mathematically rigourous ones like Foley and Van Dam,
  207. Watt's books, and a whole bunch of others, these give the theory but often
  208. don't have much in the line of implemtation info. Then there are the 3d
  209. game programming books. They give a lot of code but sometimes they do
  210. weird things.  
  211.  
  212. David Matiskella
  213. matiskel@aa.washington.edu
  214.  
  215.  
  216.  
  217. +++++++++++++++++++++++++++
  218.  
  219. >From bwade@qualia.com (Bretton Wade)
  220. Date: Fri, 25 Oct 1996 10:38:38 -0400
  221. Organization: qualia, inc.
  222.  
  223. In article <g-kendall-2410961841110001@lucky128.nuts.nwu.edu>,
  224. g-kendall@nwu.edu (Brian Kendall) wrote:
  225.  
  226. # game and I have to worry about z-buffering and speed. Since there is a lot
  227.  
  228. You don't necessarily need Z-buffering. Read over the BSP tree FAQ
  229.  
  230.    http://www.qualia.com/bspfaq/
  231.  
  232. then go get the demo application (windows 95/NT4.0 or MacOS)
  233.  
  234.    ftp://ftp.qualia.com/pub/bspfaq/
  235.  
  236. which has COMPLETE source code for a basic 3D renderer. This code was
  237. intended to be demonstrative of principles, and is not built for speed. It
  238. does not include things like texture mapping, but other publicly available
  239. source does.
  240.  
  241. Bretton
  242.  
  243. -- 
  244. Bretton Wade (bwade@qualia.com)
  245. http://www.qualia.com/~bwade/
  246.  
  247. +++++++++++++++++++++++++++
  248.  
  249. >From metals@rapidnet.com (Kevin Stone)
  250. Date: 25 Oct 1996 17:47:04 -0600
  251. Organization: RapidNet
  252.  
  253. : Wow. I want to make a cool 3d game, too.
  254. : It's probably a good idea to use those two books you mentioned (if they
  255. : are a big help, lemme know :). 3d things can be a little hard, though. It
  256. : can be hard to get the perspective right. I want to make a polygon graphic
  257. : game and I have to worry about z-buffering and speed. Since there is a lot
  258. : of math and if-statements involved, it can be slowed down big time.
  259.  
  260.    Z-buffering is not really a great idea unless you're rendering several 
  261.    thousand polygons in each frame.  Depending upon the scene that you're 
  262.    rendering, the good ol' Painters algorithm is still the best way to 
  263.    go.  If you're rendering indoor scenes or scenes where the entire 
  264.    screen is getting filled up with polygons, it might be better to use an 
  265.    inversed Painters alg... basicly you sort the polygons front-to-back 
  266.    and store the polygon's scan-line endpoints in a screen-wide 
  267.    edge-list.  The main problem is that scan-lines that overlap others will 
  268.    need to get clipped, but the final outcome is a list of scan-lines that 
  269.    can be rendered without writting any pixel more than once.
  270.    
  271. : Someone suggested to me to just go and get some sort of package that has
  272. : ready made 3d code in it that runs right and fast. It seems like a good
  273. : idea (but where's the fun in that?)
  274.  
  275.    Might be a really good idea for someone who dosn't have the time or 
  276.    energy to spend a year writting their own engine. ;)
  277.  
  278. : As a final tip, I can only say one thing: don't think super duper 3d. A
  279. : macintosh (even a powermac) has it's limits. You can't have a hundred
  280. : really complex 3d objects moving around on the screen at a time unless you
  281. : have the perfect 3d code. I've lost many a good idea by trying to make
  282. : games that don't run fast enough.
  283.  
  284.    My engine will do about 18,000 texture-mapped 50-pixel triangles per 
  285.    second on my 7100-66Mhz PowerMac.  In contrast, a low-end SGI will do 
  286.    about 100,000 texture-mapped triangles per second. ;)  Nintendos
  287.    Ultra 64 will do several hundred-tousand texture-mapped tris per second.
  288.    The new 3DO system coming out next year is boasted to do 500,000 
  289.    textured tris/second, or 1,000,000 flat color tris/second.
  290.  
  291.    I think anyone who is serious about writting 3D games is best 
  292.    off writting their own engine.  Even though it took me a year to write 
  293.    my own engine, I also wrote a fairly nice 3D modeler and other tools 
  294.    which I could spruce up and sell to the public.  I'm also planning to 
  295.    licence my engine next year after I spruce it up a bit more.
  296.  
  297. : Hope this helps.
  298. : Brian K.
  299.  
  300.   Ditto.
  301.   Brian S. :)
  302.  
  303. Sincerly,
  304.   Brian Stone
  305.   Stone Entertainment
  306.   metals@rapidnet.com
  307.   Check out our website at: 
  308.   http://www.rapidnet.com/~metals/stone-entertainment.html
  309.  
  310.  
  311. ---------------------------
  312.  
  313. >From Eric Mailloux <alibaba@accent.net>
  314. Subject: An other question about Mouse move
  315. Date: Sat, 19 Oct 1996 12:04:09 -0400
  316. Organization: Total Net
  317.  
  318. I try to use the cursor device manager for moving the cursor from a
  319. point to an other ( thank to Samuel J. W. Leidy for is source code ) but
  320. I cant link my code. I find a little warnig on the CursorDevice.h file
  321. they said we cant use cursor device manager on PowerMac because it is
  322. emulated and the mixed mode manager is wrong. Some one can tell me how
  323. can I bypass this problem.
  324.  
  325. Sebastien
  326.  
  327. +++++++++++++++++++++++++++
  328.  
  329. >From pbaxter@assitivetech.com (Paul Baxter)
  330. Date: Mon, 21 Oct 1996 11:10:17 -0500
  331. Organization: (none)
  332.  
  333. In article <3268FBF9.1BC2@accent.net>, Eric Mailloux <alibaba@accent.net> wrote:
  334.  
  335. > I try to use the cursor device manager for moving the cursor from a
  336. > point to an other ( thank to Samuel J. W. Leidy for is source code ) but
  337. > I cant link my code. I find a little warnig on the CursorDevice.h file
  338. > they said we cant use cursor device manager on PowerMac because it is
  339. > emulated and the mixed mode manager is wrong. Some one can tell me how
  340. > can I bypass this problem.
  341. > Sebastien
  342.  
  343. Hi,
  344.  You need to get the file CursorDevices.Glue.c.
  345.  
  346. -- 
  347. Paul Baxter
  348. pbaxter@assistivetech.com
  349.  
  350. +++++++++++++++++++++++++++
  351.  
  352. >From mhartman@opencluster.com (Michael Hartman)
  353. Date: Wed, 23 Oct 1996 00:01:48 -0400
  354. Organization: Open Cluster Software
  355.  
  356. In article <3268FBF9.1BC2@accent.net>, Eric Mailloux <alibaba@accent.net> wrote:
  357.  
  358. > I try to use the cursor device manager for moving the cursor from a
  359. > point to an other ( thank to Samuel J. W. Leidy for is source code ) but
  360. > I cant link my code. I find a little warnig on the CursorDevice.h file
  361. > they said we cant use cursor device manager on PowerMac because it is
  362. > emulated and the mixed mode manager is wrong. Some one can tell me how
  363. > can I bypass this problem.
  364. > Sebastien
  365.  
  366. The latest ETO, #21, has a new version of CursorDevices.h that provides
  367. the two routines you need for positioning the mouse.  Or you can just put
  368. these lines in your current copy:
  369.  
  370. pascal OSErr CrsrDevMoveTo(CursorDevicePtr ourDevice, long absX, long absY)
  371.  TWOWORDINLINE(0x7001, 0xAADB);
  372.  
  373. pascal OSErr CrsrDevNextDevice(CursorDevicePtr *ourDevice)
  374.  TWOWORDINLINE(0x700B, 0xAADB);
  375.  
  376. Note that these are the "old" names.  These should work on all existing
  377. Power Macs; and I suppose that when/if InterfaceLib is actually corrected
  378. some year, these old names will be provided for compatibility.
  379.  
  380. -- 
  381.  
  382. Michael Hartman
  383.  
  384. ---------------------------
  385.  
  386. >From J.P.Djajadiningrat@IO.TUDelft.NL (J.P. Djajadiningrat)
  387. Subject: CopyBits performance = ü(window position)?
  388. Date: 18 Oct 1996 20:41:49 GMT
  389. Organization: Delft University of Technology
  390.  
  391. >From measuring frame rates I get the strong impression that CopyBits
  392. performance strongly depends upon window position on the screen. If this
  393. is so, can someone tell me the rules, or point me in the right direction?
  394. (I've read the FAQ but couldn't find anything on window position).
  395.  
  396. Yes, bitdepth and size of offscreen GWorld and window are already the same.
  397.  
  398. Tom
  399.  
  400. +++++++++++++++++++++++++++
  401.  
  402. >From abrownswor@ea.com (Andrew Brownsword)
  403. Date: 19 Oct 1996 00:58:04 GMT
  404. Organization: Electronic Arts (Canada), Inc.
  405.  
  406. In article <J.P.Djajadiningrat-1810962243300001@io56.pstngw.tudelft.nl>,
  407. J.P.Djajadiningrat@IO.TUDelft.NL (J.P. Djajadiningrat) wrote:
  408.  
  409. >From measuring frame rates I get the strong impression that CopyBits
  410. >performance strongly depends upon window position on the screen. If this
  411. >is so, can someone tell me the rules, or point me in the right direction?
  412. >(I've read the FAQ but couldn't find anything on window position).
  413. >
  414. >Yes, bitdepth and size of offscreen GWorld and window are already the same.
  415. >
  416. >Tom
  417.  
  418. To make CopyBits run faster you need to ensure that both the source and
  419. the destination images are aligned on the machine's word boundries.  On a
  420. 680x0 it is sufficient to align both source and destination on 4 byte
  421. boundries.  On the PowerPC there is potential benefit to 8 byte alignment,
  422. especially if you are doing a straight copy to VRAM (no scaling, palette
  423. conversion, depth conversion, etc).  This means that your window should be
  424. have a horizontal position divisable by 8 in 8bit, 4 in 16bit, or 2 in
  425. 32bit.  The GWorld routines will ensure that your source is aligned on at
  426. least 4 byte boundries (possibly 8 or 16, I'm not sure), assuming you are
  427. copying the entire image.
  428.  
  429. -- 
  430. Andrew Brownsword
  431. Software Engineer
  432. Electronic Arts (Canada), Inc.
  433. - ----------------------------
  434. "The opinions expressed in this message are my own and don't necessarily reflect those of my employer."
  435.  
  436. +++++++++++++++++++++++++++
  437.  
  438. >From David Matiskella <matiskel@aa.washington.edu>
  439. Date: Fri, 18 Oct 1996 18:44:40 -0700
  440. Organization: University of Washington
  441.  
  442. On 18 Oct 1996, Gregory J Hinkle wrote:
  443.  
  444. > J.P. Djajadiningrat (J.P.Djajadiningrat@IO.TUDelft.NL) wrote:
  445. > : From measuring frame rates I get the strong impression that CopyBits
  446. > : performance strongly depends upon window position on the screen. If this
  447. > : is so, can someone tell me the rules, or point me in the right direction?
  448. > : (I've read the FAQ but couldn't find anything on window position).
  449. > : Yes, bitdepth and size of offscreen GWorld and window are already the same.
  450. > : Tom
  451. > I believe it is fastest if the origin of the pixmap in memory is 
  452. > divisible by 4. Or X by Y is divisible by four.
  453. I think develop 11 had an article on it. The article is a bit dated as
  454. it's pre powermac. That being said On a power mac you want to align to
  455. doubles if  you are going to be using doubles for copying. Your y location
  456. shouldn't matter.  That being said I believe NewGWorld returns a 4 byte
  457. aligned pixelmap. The solution I have seen is to create a pixmap bigger
  458. than the one you need and just ignore the first couple columns which are
  459. not aligned. I am sure that this something that will (maybe already has)
  460. change in the future.
  461.  
  462. David Matiskella
  463. matiskel@aa.washington.edu
  464.  
  465.  
  466.  
  467. +++++++++++++++++++++++++++
  468.  
  469. >From squires@crl.com (Scott Squires)
  470. Date: Fri, 18 Oct 1996 22:25:02 -0800
  471. Organization: Puffin Designs
  472.  
  473. In article <abrownswor-1810961759420001@s10142.eac.ea.com>,
  474. abrownswor@ea.com (Andrew Brownsword) wrote:
  475.  
  476. >In article <J.P.Djajadiningrat-1810962243300001@io56.pstngw.tudelft.nl>,
  477. >J.P.Djajadiningrat@IO.TUDelft.NL (J.P. Djajadiningrat) wrote:
  478. >
  479. >>From measuring frame rates I get the strong impression that CopyBits
  480. >>performance strongly depends upon window position on the screen. If this
  481. >>is so, can someone tell me the rules, or point me in the right direction?
  482. >>(I've read the FAQ but couldn't find anything on window position).
  483. >>
  484. >>Yes, bitdepth and size of offscreen GWorld and window are already the same.
  485. >>
  486. >>Tom
  487. >
  488. >To make CopyBits run faster you need to ensure that both the source and
  489. >the destination images are aligned on the machine's word boundries. 
  490.  
  491. You can use routines in QuickDraw to AlignWindows so they snap to
  492. the correct placement.  You can also do an UpdateGWorld and pass it
  493. global coordniates.  It will use the extra bytes of the GWorld rowbytes
  494. to align it to the window.
  495.  
  496. -scott
  497.  
  498.  
  499. Scott Squires               "Insert funny stuff here"
  500. squires@crl.com
  501. ScottSquir@aol.com
  502.  
  503.  
  504. +++++++++++++++++++++++++++
  505.  
  506. >From ghinkle@blue.seas.upenn.edu (Gregory J Hinkle)
  507. Date: 18 Oct 1996 22:17:47 GMT
  508. Organization: University of Pennsylvania
  509.  
  510. J.P. Djajadiningrat (J.P.Djajadiningrat@IO.TUDelft.NL) wrote:
  511. : From measuring frame rates I get the strong impression that CopyBits
  512. : performance strongly depends upon window position on the screen. If this
  513. : is so, can someone tell me the rules, or point me in the right direction?
  514. : (I've read the FAQ but couldn't find anything on window position).
  515.  
  516. : Yes, bitdepth and size of offscreen GWorld and window are already the same.
  517.  
  518. : Tom
  519.  
  520. I believe it is fastest if the origin of the pixmap in memory is 
  521. divisible by 4. Or X by Y is divisible by four.
  522.  
  523. --
  524. *******************************************************************************
  525. *   _/_/_/    _/    _/  |  University of Pennsylvania, School of Engineering  *
  526. *  _/    _/   _/    _/  |---------------------------------------------------- *
  527. *  _/         _/    _/  |  Box 0859                  |  Drive Defensivly...   *
  528. *  _/  _/_/   _/_/_/_/  |  3901 Locust Walk          |      Buy a Tank.       *
  529. *  _/    _/   _/    _/  |  Philadelphia, Pa 19104    |    --Greg Hinkle--     *
  530. *    _/_/     _/    _/  |-----------------------------------------------------*
  531. *_______________________|        http://homepage.seas.upenn.edu/~ghinkle/     *
  532. *    Greg      Hinkle   |             ghinkle@eniac.seas.upenn.edu            *
  533. *******************************************************************************
  534.  
  535. +++++++++++++++++++++++++++
  536.  
  537. >From J.P.Djajadiningrat@IO.TUDelft.NL (J.P. Djajadiningrat)
  538. Date: 23 Oct 1996 09:03:48 GMT
  539. Organization: Delft University of Technology
  540.  
  541. Many thanks to all who replied to my question!
  542.  
  543. Tom
  544.  
  545. ---------------------------
  546.  
  547. >From "Brian Mowatt" <Brian.Mowatt@dial.pipex.com>
  548. Subject: Disk swapping problem - floppy reading floppy
  549. Date: 17 Oct 1996 10:28:30 GMT
  550. Organization: Crocodile Clips Ltd.
  551.  
  552.  Hi. 
  553. My problem is this I wish to run a program from a floppy that requires the
  554. user to put other floppies in. Because its part of an installation process
  555. I cant really copy the program to the hard disk and run it from there.
  556.  I'm getting a ridiculous amount of disk swaps - its a REAL pain - and
  557. unusuable. Im no expert on the mac memory management, but I reckon the mac
  558. is needing the original (program containing) disk every other line of code,
  559. in order to know what to do. The solution would probably be to preload ALL
  560. the code and resource segments i need to use, and lock them somehow - but i
  561. cant seem to find out how to do this...I can find plenty about locking say
  562. some data you've put on the heap etc.
  563. Does anyone know a simple way round this. Something like 
  564. "look here system, load ALL of me, and don't unload me untill i'm finished.
  565. Just leave me ALONE!"
  566. my prog. isn't big, and not run for long, so such system unfriendly
  567. behaviour shouldn't be a problem.
  568. There must be loads of people who've encountered this problem!
  569. Thanks in advance.
  570. -- 
  571. Brian.Mowatt@dial.pipex.com
  572. Software Developer
  573. Crocodile Clips ltd.
  574.  
  575.  
  576. +++++++++++++++++++++++++++
  577.  
  578. >From jumplong@aol.com (Jump Long)
  579. Date: 18 Oct 1996 00:04:27 -0400
  580. Organization: America Online, Inc. (1-800-827-6364)
  581.  
  582. Brian Mowatt wrote:
  583.  
  584. > Hi.  My problem is this I wish to run a program from a floppy
  585. >that requires the user to put other floppies in. Because its
  586. >part of an installation process I cant really copy the program
  587. >to the hard disk and run it from there.
  588. > I'm getting a ridiculous amount of disk swaps - its a REAL pain
  589. >- and unusuable. Im no expert on the mac memory management, but
  590. >I reckon the mac is needing the original (program containing)
  591. >disk every other line of code, in order to know what to do. The
  592. >solution would probably be to preload ALL the code and resource
  593. >segments i need to use, and lock them somehow - but i cant seem
  594. >to find out how to do this...I can find plenty about locking say
  595. >some data you've put on the heap etc. Does anyone know a simple
  596. >way round this. Something like  "look here system, load ALL of
  597. >me, and don't unload me untill i'm finished. Just leave me
  598. >ALONE!" my prog. isn't big, and not run for long, so such system
  599. >unfriendly behaviour shouldn't be a problem. There must be loads
  600. >of people who've encountered this problem! Thanks in advance.
  601.  
  602. Make your resources preload and non-purgable and you'll probably solve
  603. your problems.
  604.  
  605. If after that, you're *still* getting the Disk Switch dialog, you can
  606. break at the address DskSwtchHook (3EA) points to with this MacsBug
  607. command:
  608.  
  609.   BR 3EA^ ';DM RA0 iopb'
  610.  
  611. That will break into MacsBug, right before the File Manager's Disk Switch
  612. code is run, with the parameter block pointer of the call causing the I/O
  613. to the offline/ejected disk in register A0. The ';DM RA0 iopb' part of
  614. that command line tells MacsBug to show you the parameter block.
  615.  
  616. >From there, you should be able to look at the ioTrap field to see what
  617. File Manager call is trying to execute and what it is trying to access on
  618. the offline/ejected disk. ioTrap will either have the A-Trap work in it,
  619. or if the high nibble isn't "A", then it will have the HFSDispatch trap
  620. selector in the low byte.
  621.  
  622. - Jim Luther
  623.  
  624. +++++++++++++++++++++++++++
  625.  
  626. >From "Brian Mowatt" <Brian.Mowatt@dial.pipex.com>
  627. Date: 18 Oct 1996 15:09:19 GMT
  628. Organization: Crocodile Clips Ltd.
  629.  
  630. > I wrote:
  631. > > Hi.  My problem is this I wish to run a program from a floppy
  632. > >that requires the user to put other floppies in. Because its
  633. > >part of an installation process I cant really copy the program
  634. > >to the hard disk and run it from there.
  635. > > I'm getting a ridiculous amount of disk swaps - its a REAL pain
  636. > >- and unusuable.  .. ...
  637. etc.
  638. .........There must be loads
  639. > >of people who've encountered this problem! Can anyone help?
  640.   Thanks in advance.
  641.  
  642. Jump Long <jumplong@aol.com> replied in  in article
  643. <546vkb$34a@newsbf02.news.aol.com>...
  644.  
  645. > Make your resources preload and non-purgable and you'll probably solve
  646. > your problems.
  647. > If after that, you're *still* getting the Disk Switch dialog, you can
  648. > break at the address DskSwtchHook (3EA) points to with this MacsBug
  649. > command:
  650. >   BR 3EA^ ';DM RA0 iopb'  ..
  651.  
  652.  .. and a lot more besides 
  653.  
  654. - Jim Luther
  655.  
  656.  Thanks Jim, but unfortunately that doesn't help much. I went through my
  657. code segements with resedit making them preload no purge, (and
  658. interestingly i HAD to lock some when i did this or things fell over! -
  659. strange that it was exactly the same code that normally ran OK, just
  660. resource attributes altered in resedit..)
  661.  Unfortunately what I know about macsbug could be written on the edge of a
  662. postage stamp, so the more low level stuff is a bit (though not
  663. completely!) lost on me. I dont have the time to learn about macsbug do
  664. you.. or anyone else have and more suggestions?
  665.  
  666.  I though if i preloaded and locked everything all would be OK. But it
  667. wasnt, and i'm fast running out of ideas!
  668. Please .. someone!!
  669.  
  670. Brian.Mowatt@dial.pipex.com
  671. Software developer.
  672. Crocodile clips ltd. 
  673.  
  674. +++++++++++++++++++++++++++
  675.  
  676. >From jumplong@aol.com (Jump Long)
  677. Date: 24 Oct 1996 01:26:21 -0400
  678. Organization: America Online, Inc. (1-800-827-6364)
  679.  
  680. Brian Mowatt wrote:
  681. >Unfortunately what I know about macsbug could be written on the
  682. >edge of a postage stamp, so the more low level stuff is a bit
  683. >(though not completely!) lost on me. I dont have the time to
  684. >learn about macsbug do you.. or anyone else have and more
  685. >suggestions?
  686.  
  687. Take the time to learn MacsBug. It's my favorite debugging tool and with
  688. it, you'll be able to do things high-level debuggers just dream of.
  689.  
  690. Jim Luther
  691. MacsBug is the source level debugger for my assembler
  692.  
  693. ---------------------------
  694.  
  695. >From usenet@techtalk.se (Mikael Skogström)
  696. Subject: Documentation tool?
  697. Date: 17 Oct 1996 10:04:25 GMT
  698. Organization: TechTalk
  699.  
  700. Is there a Mac based documentation tool to ease the documentation
  701. process associated with software development? For example, an
  702. application that can interprete C++ and Pascal code, and the use of
  703. different classes, and turn it into some kind of a flow chart? And
  704. maybe even display the gathered the information in a number of other
  705. ways?
  706.  If there isn't such a tool for the Mac, maybe you know of one for PCs?
  707.  
  708. Mikael
  709.  
  710. +++++++++++++++++++++++++++
  711.  
  712. >From usenet@techtalk.se (Mikael Skogström)
  713. Date: 19 Oct 1996 09:54:59 GMT
  714. Organization: TechTalk
  715.  
  716. In article <jordanz-1710960922570001@204.147.232.52>
  717. jordanz@altura.com (Jordan Zimmerman) writes:
  718.  
  719. > Object Master is good at this.
  720.  
  721. Okay. Who's manufacturing it and do I find them on the Net?
  722.  
  723. Mikael
  724.  
  725. +++++++++++++++++++++++++++
  726.  
  727. >From jordanz@altura.com (Jordan Zimmerman)
  728. Date: Thu, 17 Oct 1996 09:22:26 -0800
  729. Organization: Altura Software, Inc.
  730.  
  731. In article <5450b9$78h@epimetheus.algonet.se>, usenet@techtalk.se (Mikael
  732. Skogström) wrote:
  733.  
  734. > Is there a Mac based documentation tool to ease the documentation
  735. > process associated with software development? For example, an
  736. > application that can interprete C++ and Pascal code, and the use of
  737. > different classes, and turn it into some kind of a flow chart? And
  738. > maybe even display the gathered the information in a number of other
  739. > ways?
  740. >  If there isn't such a tool for the Mac, maybe you know of one for PCs?
  741. > Mikael
  742.  
  743. Object Master is good at this.
  744.  
  745. -- 
  746. Jordan Zimmerman
  747. Altura Software, Inc.
  748. home page: http://www.altura.com/jordanz
  749.  
  750. Harry Browne for President!    
  751. http://www.harrybrowne96.org   1 (800) 682 1776
  752. Stop the Browne Out! Let Harry Browne debate!     http://www.twr.com/STBO
  753.  
  754. +++++++++++++++++++++++++++
  755.  
  756. >From david_rehring@gdt.com (David Rehring)
  757. Date: Wed, 23 Oct 1996 17:48:45 -0700
  758. Organization: GDT Softworks, Inc.
  759.  
  760. In article <54a8hj$2ct@epimetheus.algonet.se>, usenet@techtalk.se (Mikael
  761. Skogström) wrote:
  762.  
  763. >>In article <jordanz-1710960922570001@204.147.232.52>
  764. >>jordanz@altura.com (Jordan Zimmerman) writes:
  765. >>
  766. >>> Object Master is good at this.
  767. >>
  768. >>Okay. Who's manufacturing it and do I find them on the Net?
  769. >>
  770. >>Mikael
  771.  
  772. ACI US
  773.  
  774. try www.acius.com
  775.  
  776. -- 
  777. David Rehring
  778. Senior Software Engineer
  779. GDT Softworks, Inc.
  780. And all around insane guy!
  781.  
  782. ---------------------------
  783.  
  784. >From Moritz Borgmann <Moritz_Borgmann@magicvillage.de>
  785. Subject: Drawing to MenuBar from SystemTask patch
  786. Date: Fri, 25 Oct 1996 22:56:41 +0100
  787. Organization: none
  788.  
  789. I guess this is something for the real mac programming gurus :-)
  790.  
  791. What I am trying to accomplish is the following: I want to display
  792. some clock-like information in the menu bar, exactly as system 7.5
  793. does. This should be updated in real time and look nice, without
  794. flickering.
  795.  
  796. So I wrote an INIT which installs two trap patches: DrawMenuBar (tail
  797. patch) and SystemTask (head patch). The first time the DrawMenuBar
  798. patch is called, it allocates a new offscreen GWorld via NewGWorld in
  799. the System heap.
  800. Apart from that, both patches do exactly the same:
  801.  
  802. -SetZone(SystemZone()), so that any new data structures will be
  803. allocated in the system heap and not in the current heap which may be
  804. any application's heap
  805. -allocate space for an new CGrafPort via NewPtr
  806. -open the new CGrafPort via OpenCPort (drawing to this port draws
  807. directly to the desktop)
  808. -if necessary, call UpdateGWorld to reflect changes in the size of the
  809. stuff to be displayed
  810. -get the current GWorld
  811. -SetGWorld to the offscreen world
  812. -draw the stuff
  813. -set the GWorld back
  814. -copy the offscreen data into the menu bar area of the new port using
  815. CopyBits
  816. -close the new port and dispose of the memory
  817. -set the current zone back
  818.  
  819. Most of the time, this works fine. Everything is displayed very
  820. smoothly, without flicker, the system isn't slowed down. But very
  821. seldomly, my Mac crashes, and I suspect that my routines are causing
  822. the trouble. Thus, my question is: Is it safe to do what I'm doing? Am
  823. I missing something that I should pay attention to? Could I do this in
  824. a less ugly way (without trap patching)?
  825.  
  826. Any advice will be greatly appreciated,
  827.  
  828. Moritz
  829.  
  830. +++++++++++++++++++++++++++
  831.  
  832. >From Moritz Borgmann <Moritz_Borgmann@magicvillage.de>
  833. Date: Sat, 26 Oct 1996 16:24:38 +0100
  834. Organization: none
  835.  
  836. Tom Dowdy wrote:
  837. >you do seem to be missing a set/restore port/device around the open/close 
  838. >c ports.
  839. >
  840. >Some apps may assume that the current port doesn't change across a call 
  841. >to SystemTask().
  842.  
  843. Eh, sorry, I forgot to tell you that I of course DO save/restore the
  844. port. Anything else would be crashing the mac right away, I guess.
  845.  
  846. Scott Kevill wrote:
  847. >Are you calling LockPixels() on the GWorld PixMapHandle before drawing
  848. >into the GWorld?
  849.  
  850. Yeah, I do that, too.
  851. This is what makes me a bit desperate: I seem to obeye all the rules of
  852. dealing with offscreen graphics, but it still crashes sometimes. Thanks
  853. anyway for your replies.
  854.  
  855. Moritz
  856. Moritz_Borgmann@magicvillage.de
  857.  
  858. +++++++++++++++++++++++++++
  859.  
  860. >From scott@www.curtin.edu.au (Scott Kevill)
  861. Date: Sat, 26 Oct 1996 11:23:46 +0800
  862. Organization: Curtin University of Technology    
  863.  
  864. In article <32713799.76B8@magicvillage.de>,
  865. Moritz_Borgmann@magicvillage.de wrote:
  866.  
  867. :Most of the time, this works fine. Everything is displayed very
  868. :smoothly, without flicker, the system isn't slowed down. But very
  869. :seldomly, my Mac crashes, and I suspect that my routines are causing
  870. :the trouble. Thus, my question is: Is it safe to do what I'm doing? Am
  871. :I missing something that I should pay attention to? Could I do this in
  872. :a less ugly way (without trap patching)?
  873. :
  874. :Any advice will be greatly appreciated,
  875.  
  876. Are you calling LockPixels() on the GWorld PixMapHandle before drawing
  877. into the GWorld?
  878.  
  879. That's all that comes to mind at the moment.
  880.  
  881. Hope this helps.
  882.  
  883. Scott Kevill
  884. scott@www.curtin.edu.au
  885.  
  886. :
  887. :Moritz
  888.  
  889. +++++++++++++++++++++++++++
  890.  
  891. >From samizdat@earthlink.net (Chris Kelly)
  892. Date: Sat, 26 Oct 1996 12:02:05 -0800
  893. Organization: Samizdat Productions
  894.  
  895. Have you tried doing your memory allocations just once, instead of each
  896. time your patch is called?
  897.  
  898. Hope that helps.
  899.  
  900. Chris Kelly
  901.  
  902. In article <32722D35.63A7@magicvillage.de>,
  903. Moritz_Borgmann@magicvillage.de wrote:
  904.  
  905. > Tom Dowdy wrote:
  906. > >you do seem to be missing a set/restore port/device around the open/close 
  907. > >c ports.
  908. > >
  909. > >Some apps may assume that the current port doesn't change across a call 
  910. > >to SystemTask().
  911. > Eh, sorry, I forgot to tell you that I of course DO save/restore the
  912. > port. Anything else would be crashing the mac right away, I guess.
  913. > Scott Kevill wrote:
  914. > >Are you calling LockPixels() on the GWorld PixMapHandle before drawing
  915. > >into the GWorld?
  916. > Yeah, I do that, too.
  917. > This is what makes me a bit desperate: I seem to obeye all the rules of
  918. > dealing with offscreen graphics, but it still crashes sometimes. Thanks
  919. > anyway for your replies.
  920. > Moritz
  921. > Moritz_Borgmann@magicvillage.de
  922.  
  923. ---------------------------
  924.  
  925. >From 100042.2514@compuserve.com (Kevin Ashbridge)
  926. Subject: FSpExchangeFiles example has a bug?
  927. Date: Sun, 20 Oct 1996 19:58:57 +0200
  928. Organization: Rainy Night Software
  929.  
  930. SmartFriends,
  931.  
  932. I'm working my way through IM:Files. In the example given to "safe save" a
  933. document, the code snippet (Listing 1-10; shown below) returns an fBsyErr
  934. in the final statement when compiled. I don't understand why it should. The
  935. fBsyErr error occurs when FSpDelete is called, indicating "File busy,
  936. directory not empty, or working directory control block open". However, the
  937. code snippet has explicitly called FSClose. What gives?
  938.  
  939. -- Kevin.
  940.  
  941.  
  942.   myFSpec := myData^^.fileFSSpec;           {get FSSpec for existing file}
  943.  
  944.   GetDateTime(myTime);                      {create a temporary filename}
  945.   NumToString(myTime, myName);
  946.  
  947.   {Find the temporary folder on file's volume; create it if necessary.}
  948.   myErr := FindFolder(myFSpec.vRefNum, kTemporaryFolderType,
  949.                        kCreateFolder, myVRef, myDirID);
  950.   IF myErr = noErr THEN                     {make an FSSpec for temp file}
  951.      myErr := FSMakeFSSpec(myVRef, myDirID, myName, myTSpec);
  952.   IF (myErr = noErr) OR (myErr = fnfErr) THEN{create a temporary file}
  953.      myErr := FSpCreate(myTSpec, 'trsh', 'trsh', smSystemScript);
  954.   IF myErr = noErr THEN                     {open the newly created file}
  955.      myErr := FSpOpenDF(myTSpec, fsRdWrPerm, myTemp);
  956.   IF myErr = noErr THEN                     {write data to the data fork}
  957.      myErr := DoWriteData(myWindow, myTemp);
  958.   IF myErr = noErr THEN                     {close the temporary file}
  959.      myErr := FSClose(myTemp);
  960.   IF myErr = noErr THEN                     {swap data in the two files}
  961.      myErr := FSpExchangeFiles(myTSpec, myFSpec);
  962.   IF myErr = noErr THEN                     {delete the temporary file}
  963.      myErr := FSpDelete(myTSpec);  <--- fBsyErr here!!
  964.  
  965.  
  966.  
  967.  
  968. +++++++++++++++++++++++++++
  969.  
  970. >From "K. J. Bricknell" <brick@spirit.com.au>
  971. Date: Mon, 21 Oct 1996 17:57:48 +1100
  972. Organization: Spirit Networks - Canberra, Australia
  973.  
  974. Kevin Ashbridge wrote:
  975. > I'm working my way through IM:Files. In the example given to "safe save" a
  976. > document, the code snippet (Listing 1-10; shown below) returns an fBsyErr
  977. > in the final statement when compiled ...
  978.  
  979. Kevin,
  980.  
  981. That one drove me bonkers for a while, too.  The only way I could find
  982. around it was as as per the following example:
  983.  
  984. *****************************************************************************
  985.  
  986. OSErr  doWriteFile(WindowPtr windowPtr,Boolean newFile)
  987. {
  988.   docRecordHandle  docRecHdl;
  989.   FSSpec           fileSpecActual, fileSpecTemp;
  990.   UInt32           currentTime;
  991.   Str255           tempFileName;
  992.   SInt16           tempFileVolNum, tempFileRefNum;
  993.   SInt32           tempFileDirID;
  994.   OSErr            osError;
  995.  
  996.   docRecHdl = (docRecordHandle) GetWRefCon(windowPtr);
  997.   fileSpecActual = (*docRecHdl)->fileFSSpec;
  998.  
  999.   GetDateTime(¤tTime);
  1000.   NumToString((SInt32) currentTime,tempFileName);
  1001.   
  1002.   osError = FindFolder(fileSpecActual.vRefNum,kTemporaryFolderType,
  1003.                        kCreateFolder &tempFileVolNum,&tempFileDirID);
  1004.   if(osError == noErr)
  1005.     osError = FSMakeFSSpec(tempFileVolNum,tempFileDirID,tempFileName,
  1006.                            &fileSpecTemp);
  1007.   if(osError == noErr || osError == fnfErr)
  1008.     osError = FSpCreate(&fileSpecTemp,'trsh','trsh',smSystemScript);
  1009.   if(osError == noErr)
  1010.     osError = FSpOpenDF(&fileSpecTemp,fsRdWrPerm,&tempFileRefNum);
  1011.   if(osError == noErr)
  1012.     osError = doWriteTextData(windowPtr,tempFileRefNum);
  1013.   if(osError == noErr)
  1014.     osError = FSClose(tempFileRefNum);
  1015.   if(osError == noErr)
  1016.     osError = FSClose((*docRecHdl)->fileRefNum);// NEW: CLOSE THE ACTUAL
  1017. FILE
  1018.   if(osError == noErr)
  1019.     osError = FSpExchangeFiles(&fileSpecTemp,&fileSpecActual);
  1020.   if(osError == noErr)
  1021.     osError = FSpDelete(&fileSpecTemp);
  1022.   if(osError == noErr)                          // THEN OPEN IT AGAIN!
  1023.     osError =
  1024. FSpOpenDF(&fileSpecActual,fsRdWrPerm,&(*docRecHdl)->fileRefNum);
  1025.  
  1026.   if(osError == noErr)
  1027.   {
  1028.     if(newFile)
  1029.       osError = doCopyAppNameResource(windowPtr);
  1030.   }
  1031.  
  1032.   return(osError);
  1033. }
  1034.  
  1035. ******************************************************************************
  1036.  
  1037. This has all the logic of finding an open door and then closing it
  1038. before opening it again to walk through it.  However, it is the only way
  1039. I could get FSpExchangeFiles to behave itself.
  1040.  
  1041. I have seen other writings which indicate that there is something amiss
  1042. with either FSpExchangeFiles or the way it is documented.  Given your
  1043. experience, I am now convinced that that is the case.
  1044.  
  1045. K. J. Bricknell
  1046. Canberra
  1047. Australia
  1048.  
  1049. +++++++++++++++++++++++++++
  1050.  
  1051. >From jumplong@aol.com (Jump Long)
  1052. Date: 24 Oct 1996 01:51:21 -0400
  1053. Organization: America Online, Inc. (1-800-827-6364)
  1054.  
  1055. Kevin Ashbridge wrote:
  1056.  
  1057. >I'm working my way through IM:Files. In the example given to
  1058. >"safe save" a document, the code snippet (Listing 1-10; shown
  1059. >below) returns an fBsyErr in the final statement when compiled.
  1060. >I don't understand why it should. The fBsyErr error occurs when
  1061. >FSpDelete is called, indicating "File busy, directory not empty,
  1062. >or working directory control block open". However, the code
  1063. >snippet has explicitly called FSClose. What gives?
  1064.  
  1065. The code snippet is wrong. For an good explanation of what
  1066. FSpExchangeFiles and PBExchangeFiles really do, see the Macintosh
  1067. Technical Note "Inside Macintosh Files Errata".
  1068.  
  1069. - Jim Luther
  1070.  
  1071. ---------------------------
  1072.  
  1073. >From Thomas Wurst <zxmjx02@hp22.zdv.uni-tuebingen.de>
  1074. Subject: FSpExchangeFiles-"safe-save"
  1075. Date: Tue, 22 Oct 1996 20:15:12 +0200
  1076. Organization: InterNetNews at ZDV Uni-Tuebingen
  1077.  
  1078. Hello all!
  1079.  
  1080. To save my documents in a safe way I'm using the "safe-save" mechanism 
  1081. described in IM Files (create a temporary file in the trash using the 
  1082. number of ticks since startup as filename, write all the data to that file, 
  1083. then exchange the document file with the temporary one).
  1084. But after doing so, and then restarting my Mac, I suddenly have all the 
  1085. created temporary files (now empty, of course) lurking in my trash!
  1086.  
  1087. What I'm wondering right now is this: does the "safe-save" mechanism from 
  1088. IM Files all the work for me (including the proper deletion of all the 
  1089. temporary files) -- would mean I'm making something wrong in my 
  1090. implementation of that example code -- or do I have to delete them on my 
  1091. own?
  1092.  
  1093. Any comments on this appreciating: Thomas.
  1094.  
  1095. +++++++++++++++++++++++++++
  1096.  
  1097. >From jumplong@aol.com (Jump Long)
  1098. Date: 24 Oct 1996 01:57:31 -0400
  1099. Organization: America Online, Inc. (1-800-827-6364)
  1100.  
  1101. >To save my documents in a safe way I'm using the "safe-save"
  1102. >mechanism  described in IM Files (create a temporary file in the
  1103. >trash using the  number of ticks since startup as filename,
  1104. >write all the data to that file,  then exchange the document
  1105. >file with the temporary one). But after doing so, and then
  1106. >restarting my Mac, I suddenly have all the  created temporary
  1107. >files (now empty, of course) lurking in my trash!
  1108. >
  1109. >What I'm wondering right now is this: does the "safe-save"
  1110. >mechanism from  IM Files all the work for me (including the
  1111. >proper deletion of all the  temporary files) -- would mean I'm
  1112. >making something wrong in my  implementation of that example
  1113. >code -- or do I have to delete them on my  own?
  1114.  
  1115. The code snippet in Inside Macintosh: Files showing how to use
  1116. ExchangeFiles is wrong. See the Macintosh Technical Note "Inside
  1117. Macintosh: Files - Errata" for an explanation of how the ExchangeFiles
  1118. routines really work.
  1119.  
  1120. - Jim Luther
  1121.  
  1122. +++++++++++++++++++++++++++
  1123.  
  1124. >From hooty@odyssee.net (Eric Dorland)
  1125. Date: Thu, 24 Oct 1996 16:28:02 -0400
  1126. Organization: Odyssee Internet
  1127.  
  1128. In article
  1129. <Pine.HPP.3.91.961022200121.17090A-100000@hp22.zdv.uni-tuebingen.de>,
  1130. Thomas Wurst <zxmjx02@hp22.zdv.uni-tuebingen.de> wrote:
  1131.  
  1132. > Hello all!
  1133. > To save my documents in a safe way I'm using the "safe-save" mechanism 
  1134. > described in IM Files (create a temporary file in the trash using the 
  1135. > number of ticks since startup as filename, write all the data to that file, 
  1136. > then exchange the document file with the temporary one).
  1137. > But after doing so, and then restarting my Mac, I suddenly have all the 
  1138. > created temporary files (now empty, of course) lurking in my trash!
  1139. > What I'm wondering right now is this: does the "safe-save" mechanism from 
  1140. > IM Files all the work for me (including the proper deletion of all the 
  1141. > temporary files) -- would mean I'm making something wrong in my 
  1142. > implementation of that example code -- or do I have to delete them on my 
  1143. > own?
  1144.  
  1145. You have to make sure you delete the temporary file in the code using
  1146. FSpDelete when your done. Check page 1-25, 1-26 in IM: Files for example
  1147. code on how to do it. Right at the end you'll see the FSpDelete.
  1148.  
  1149. Eric Dorland
  1150. hooty@odyssee.net
  1151. http://www.odyssee.net/~hooty/
  1152.  
  1153. ---------------------------
  1154.  
  1155. >From frankkim@antoniades.lcs.mit.edu (Frank Kim)
  1156. Subject: Finding memory leaks in applications using malloc, free, new, delete
  1157. Date: 22 Oct 1996 14:08:12 GMT
  1158. Organization: MIT Laboratory for Computer Science, Cambridge MA
  1159.  
  1160. Hi,
  1161.  
  1162. What do you guys recommend using for finding memory leaks in
  1163. applications using malloc, free, new, delete?
  1164.  
  1165. I've been using ZoneRanger but it doesn't seem to work too well.  I am
  1166. hoping to find something like BoundsChecker on the PC.
  1167.  
  1168. By the way, ever notice that when you run a program with SIOUX console,
  1169. that the program just freezes when it runs out of memory and you have to
  1170. reboot.  Seems like a shortcoming in the way SIOUX was programmed, don't
  1171. you think?
  1172. -- 
  1173. Frank Kim    frankkim@catfish.lcs.mit.edu
  1174.         http://cag-www.lcs.mit.edu/~frankkim/
  1175.                    
  1176.  
  1177. +++++++++++++++++++++++++++
  1178.  
  1179. >From MWRon@metrowerks.com (MW Ron)
  1180. Date: Tue, 22 Oct 1996 12:19:36 -0400
  1181. Organization: Metrowerks
  1182.  
  1183. In article <54ikgc$onm@GRAPEVINE.LCS.MIT.EDU>,
  1184. frankkim@antoniades.lcs.mit.edu (Frank Kim) wrote:
  1185.  
  1186. >Hi,
  1187. >
  1188. >What do you guys recommend using for finding memory leaks in
  1189. >applications using malloc, free, new, delete?
  1190.  
  1191. Using DebugNew is the way to go.
  1192.  
  1193. >By the way, ever notice that when you run a program with SIOUX console,
  1194. >that the program just freezes when it runs out of memory and you have to
  1195. >reboot.  Seems like a shortcoming in the way SIOUX was programmed, don't
  1196. >you think?
  1197.  
  1198. I have had reports that if you run out of memory before you have written
  1199. any output to SIOUX it will hang when you try to write the error message
  1200. to the SIOUX window because there is not enough memory to initialize the
  1201. managers. If this is the error you mean, I am not sure if this is a
  1202. limitation, bug, or considered user error.
  1203.  
  1204. Ron
  1205.  
  1206. -- 
  1207. METROWERKS                   Ron Liechty
  1208. "Software at Work"    MWRon@metrowerks.com
  1209. http://www.metrowerks.com/about/people/rogues.html#mwron
  1210.  
  1211. +++++++++++++++++++++++++++
  1212.  
  1213. >From awulf@biit.com (Andrew Wulf)
  1214. Date: Tue, 22 Oct 1996 15:59:11 -0500
  1215. Organization: Biit, Inc.
  1216.  
  1217. In article <54ikgc$onm@GRAPEVINE.LCS.MIT.EDU>,
  1218. frankkim@antoniades.lcs.mit.edu (Frank Kim) wrote:
  1219.  
  1220. >Hi,
  1221. >
  1222. >What do you guys recommend using for finding memory leaks in
  1223. >applications using malloc, free, new, delete?
  1224. >
  1225. >I've been using ZoneRanger but it doesn't seem to work too well.
  1226.  
  1227. (1) You can use Metrowerks supplied DebugNew.
  1228.  
  1229. (2) For operator new/delete you can edit the file new.cp in the MWCRuntime
  1230. library, and change its setting to use NewPtr/DeletePtr. This way you can
  1231. use ZoneRanger.
  1232.  
  1233. >I am hoping to find something like BoundsChecker on the PC.
  1234.  
  1235. (3) Soon you can use my product, HeapManager, which includes an allocator
  1236. library with a debugging API, and an external application that displays
  1237. (among it's other features) all current memory allocations that came from
  1238. new/malloc, with the routine name that generated them, the size, the
  1239. address, and the order they were created. It also has a history window
  1240. that shows all allocations and frees in order with the same info. It will
  1241. be shipping in December. See the web page below for more info.
  1242.  
  1243. -- 
  1244. Andrew Wulf
  1245. Biit, Inc.
  1246.  
  1247.  
  1248.  
  1249. +++++++++++++++++++++++++++
  1250.  
  1251. >From ax52@cityscape.co.uk (Giuliano Gavazzi)
  1252. Date: Thu, 24 Oct 1996 21:13:25 +0100
  1253. Organization: myself
  1254.  
  1255. In article <awulf-2210961559120001@turnpike19.onramp.net>, awulf@biit.com
  1256. (Andrew Wulf) wrote:
  1257.  
  1258. ...
  1259. > be shipping in December. See the web page below for more info.
  1260. > -- 
  1261. > Andrew Wulf
  1262. > Biit, Inc.
  1263.  
  1264. below what?
  1265.  
  1266.  
  1267. Giuliano
  1268.  
  1269. +++++++++++++++++++++++++++
  1270.  
  1271. >From awulf@biit.com (Andrew Wulf)
  1272. Date: Fri, 25 Oct 1996 09:49:52 -0500
  1273. Organization: Biit, Inc.
  1274.  
  1275. In article <ax52-2410962113250001@news3.news.demon.net>,
  1276. ax52@cityscape.co.uk (Giuliano Gavazzi) wrote:
  1277.  
  1278. >...
  1279. >> be shipping in December. See the web page below for more info.
  1280. >> 
  1281. >> -- 
  1282. >> Andrew Wulf
  1283. >> Biit, Inc.
  1284. >
  1285. >below what?
  1286.  
  1287. Sorry, wrong signature. Try this one:
  1288.  
  1289. -- 
  1290. Andrew Wulf
  1291. Biit, Inc.
  1292. See info on HeapManager at <http://www.biit.com>
  1293.  
  1294. ---------------------------
  1295.  
  1296. >From grh@umiacs.umd.edu (Gisli R. Hjaltason)
  1297. Subject: Floating windows with Text Services (NewServiceWindow)
  1298. Date: 22 Oct 1996 13:37:06 -0400
  1299. Organization: Dept. of Computer Science, University of Maryland, College Park
  1300.  
  1301. I am adding a tool bar to an app that I'm working on. It seemed like the
  1302. floating window service in the Text Services (NewServiceWindow etc.) fit the
  1303. bill for making the tool bar float above the regular app windows. I've
  1304. gotten it to work, but there is one slight problem: if my app crashes, the
  1305. tool bar stays on the screen. Is there any way around this? (Of course, I'd
  1306. like to say that my app is bug-free, but we all know how these pesky bugs
  1307. can lurk around.)
  1308.  
  1309. I'd appreciate any advice.
  1310.  
  1311. Thanks in advance...
  1312. -- 
  1313. Gisli Runar Hjaltason              \  "Once, in the army, I was asked if I was
  1314. Department of Computer Science      \  really the composer Arnold Schoenberg.
  1315. University of Maryland, College Park \ 'Somebody had to be,' I said" Schoenberg
  1316.  
  1317. +++++++++++++++++++++++++++
  1318.  
  1319. >From baclark@enteract.com (Brian Clark)
  1320. Date: Tue, 22 Oct 1996 15:06:33 -0500
  1321. Organization: Fawlty Software Ltd.
  1322.  
  1323. In article <54j0o2$dqv@midgard.umiacs.umd.edu>, grh@umiacs.umd.edu (Gisli
  1324. R. Hjaltason) wrote:
  1325.  
  1326. >I am adding a tool bar to an app that I'm working on. It seemed like the
  1327. >floating window service in the Text Services (NewServiceWindow etc.) fit the
  1328. >bill for making the tool bar float above the regular app windows. I've
  1329. >gotten it to work, but there is one slight problem: if my app crashes, the
  1330. >tool bar stays on the screen. Is there any way around this?
  1331.  
  1332. My suggestion would be to skip the Text Services floater and use the
  1333. floating windows package from develop magazine. It does not suffer from the
  1334. drawbacks (no color support, can't change cursor when it's over the
  1335. floating window, unusual event handling) that the Text Services floaters
  1336. do. The code from develop is a bit more work to use, but worth it.
  1337.  
  1338. -- 
  1339. Thanks to everyone who has registered YA-NewsWatcher.
  1340. For the latest version (2.3.1) and helper apps, go to:
  1341. ftp://ftp.enteract.com/users/baclark/
  1342.  
  1343. +++++++++++++++++++++++++++
  1344.  
  1345. >From Jae Ho Chang <jaeho@xs4all.nl>
  1346. Date: Wed, 23 Oct 1996 21:03:11 +0200
  1347. Organization: eMusicas softwares
  1348.  
  1349. Gisli R. Hjaltason wrote:
  1350.  
  1351. > I've gotten it to work, but there is one slight problem: if my app crashes, the
  1352. > tool bar stays on the screen. Is there any way around this?
  1353.  
  1354. This could work well:
  1355. Write a jGNEFilter for the window and put it in the system heap. The
  1356. filter procedure is alive even if your program crashes.
  1357.  
  1358. Jae Ho Chang :-)
  1359. --
  1360. Check out the amazing note utility FinderNote at
  1361. <http://www.xs4all.nl/~jaeho/FinderNote>
  1362. eMusicas Home Page <http://www.xs4all.nl/~jaeho/>
  1363.  
  1364. - Let's think of the earth -
  1365.  
  1366.  
  1367. ---------------------------
  1368.  
  1369. >From uzs90z@uni-bonn.de (Michael Schuerig)
  1370. Subject: Flushing volumes from MacsBug
  1371. Date: Sun, 20 Oct 1996 01:52:24 +0200
  1372. Organization: RHRZ - University of Bonn (Germany)            
  1373.  
  1374.  
  1375. Is there a way to flush volumes from inside MacsBug? My intention, of
  1376. course, is to write the cache contents to disk after crashing into
  1377. MacsBug, but I don't necessarily want to restart (with rs).
  1378.  
  1379. Michael
  1380.  
  1381. - -
  1382. Michael Schuerig
  1383. mailto:uzs90z@uni-bonn.de
  1384. http://www.rhrz.uni-bonn.de/~uzs90z/
  1385.  
  1386. +++++++++++++++++++++++++++
  1387.  
  1388. >From andrewwelc@aol.com (AndrewWelc)
  1389. Date: 21 Oct 1996 07:16:44 -0400
  1390. Organization: America Online, Inc. (1-800-827-6364)
  1391.  
  1392. > Is there a way to flush volumes from inside MacsBug? My intention, of
  1393. > course, is to write the cache contents to disk after crashing into
  1394. > MacsBug, but I don't necessarily want to restart (with rs).
  1395.  
  1396. I suppose you could always write a 'dcmd' that attempts to do this.
  1397.  
  1398. +--------------------------------------------------------------+
  1399. |    Andrew Welch - Thaumaturgist - Ambrosia Software, Inc.    |
  1400. +-------------------------------+------------------------------+
  1401. |    AOL-> Keyword: Ambrosia    |  http://www.AmbrosiaSW.com/  |
  1402. |    CIS-> GO word: Ambrosia    |   ftp://ftp.AmbrosiaSW.com/  |
  1403. +-------------------------------+------------------------------+
  1404.  
  1405. +++++++++++++++++++++++++++
  1406.  
  1407. >From Jim Murphy <murph@apple.com>
  1408. Date: 21 Oct 1996 22:16:59 GMT
  1409. Organization: Apple Computer, Inc.
  1410.  
  1411. In article <19961020015224172099@rhrz-ts3-p3.rhrz.uni-bonn.de> 
  1412. Michael Schuerig, uzs90z@uni-bonn.de writes:
  1413. >Is there a way to flush volumes from inside MacsBug? My intention, of
  1414. >course, is to write the cache contents to disk after crashing into
  1415. >MacsBug, but I don't necessarily want to restart (with rs).
  1416.  
  1417.     If you're using MacsBug 6.5.3 (you should be), try logging something
  1418. using the log command. A sequence like this should do the trick:
  1419.  
  1420.     LOG logvol:dummylogfile; LOG
  1421.    
  1422.    (Where "logvol" is the volume you want to flush.)
  1423.    
  1424.    MacsBug 6.5.3 is extremely paranoid about getting what you logged onto
  1425. disk. If it's safe to do so (the file system isn't busy), it will do a
  1426. FlushVol after each line of output is drawn, and also when it closes the
  1427. file. You obviously need to be aware that if the crash in question somehow
  1428. wrote data over the file system cache, there is a chance you could be
  1429. writing bad data back to the disk. Buyer beware.
  1430.  
  1431.  
  1432. Jim Murphy                  Dr. MacsBug                    murph@apple.com
  1433.  
  1434. "...never quite said what I wanted to say to you,                 The Cure
  1435.   never quite managed the words to explain to you..."             Untitled
  1436.  
  1437. +++++++++++++++++++++++++++
  1438.  
  1439. >From uzs90z@uni-bonn.de (Michael Schuerig)
  1440. Date: Mon, 21 Oct 1996 22:51:16 +0200
  1441. Organization: RHRZ - University of Bonn (Germany)            
  1442.  
  1443. AndrewWelc <andrewwelc@aol.com> wrote:
  1444.  
  1445. > > Is there a way to flush volumes from inside MacsBug? My intention, of
  1446. > > course, is to write the cache contents to disk after crashing into
  1447. > > MacsBug, but I don't necessarily want to restart (with rs).
  1448. > I suppose you could always write a 'dcmd' that attempts to do this.
  1449.  
  1450. So then, does anybody have a dcmd shell for CodeWarrior available?
  1451.  
  1452. Michael
  1453.  
  1454. - -
  1455. Michael Schuerig
  1456. mailto:uzs90z@uni-bonn.de
  1457. http://www.rhrz.uni-bonn.de/~uzs90z/
  1458.  
  1459. +++++++++++++++++++++++++++
  1460.  
  1461. >From jumplong@aol.com (Jump Long)
  1462. Date: 24 Oct 1996 01:48:05 -0400
  1463. Organization: America Online, Inc. (1-800-827-6364)
  1464.  
  1465. Andrew Welch  replied:
  1466.  
  1467. >> Is there a way to flush volumes from inside MacsBug? My intention, of
  1468. >> course, is to write the cache contents to disk after crashing into
  1469. >> MacsBug, but I don't necessarily want to restart (with rs).
  1470. >
  1471. >I suppose you could always write a 'dcmd' that attempts to do this.
  1472.  
  1473. Just remember that because the File Manager may be busy and MacsBug has
  1474. the system stopped, attempting to flush a volume from within MacsBug may
  1475. just lock up your system completely.
  1476.  
  1477. - Jim Luther
  1478.  
  1479. ---------------------------
  1480.  
  1481. >From wardle@physics.usyd.edu.au (Mark Wardle)
  1482. Subject: Ftnchek 2.9.4 as an MPW tool anyone?
  1483. Date: 18 Oct 1996 05:54:00 GMT
  1484. Organization: RCfTA, U. Sydney
  1485.  
  1486. In article <onm010-1510961000580001@mueller.nucmed.medizin.uni-essen.de>,
  1487. onm010@uni-essen.de (Dr. Stefan P. Mueller) wrote:
  1488.  
  1489. > We would like to have a Macintosh version of ftnchek 2.9.4 (preferably a
  1490. > fat binary). The distribution includes a makefile for the Macintosh using
  1491. > MPW C. Unfortunately, we don't have this compiler available here. Has
  1492. > anybody with MPW C built the new version and would be willing to make the
  1493. > Mac version available? 
  1494.  
  1495.  
  1496. Any chance of somebody making an updated MPW tool (68k) available?
  1497. The version at switch is 2.7, I believe.
  1498.  
  1499. Are there any other fortran77-related MPW tools I should know about?
  1500.  
  1501. Thanks!
  1502.  
  1503. +++++++++++++++++++++++++++
  1504.  
  1505. >From m.evrard@fusion.rma.ac.be (M.Evrard)
  1506. Date: Mon, 21 Oct 1996 11:25:09 +0100
  1507. Organization: Royal Military Academy (ERM/KMS), Brussels
  1508.  
  1509. In article <wardle-1810961555560001@mephistopheles.physics.usyd.edu.au>,
  1510. wardle@physics.usyd.edu.au (Mark Wardle) wrote:
  1511.  
  1512. > Any chance of somebody making an updated MPW tool (68k) available?
  1513. > The version at switch is 2.7, I believe.
  1514.  
  1515. I uploaded this weekend the MPW tool version to R.Moniot (the author of ftnchek)
  1516. and it should appear very soon at the usual places.
  1517.  
  1518. > Thanks!
  1519.  
  1520. Never mind.
  1521.  
  1522.  
  1523. Michel Evrard
  1524.  
  1525. +++++++++++++++++++++++++++
  1526.  
  1527. >From moniot@sobolev.dsm.fordham.edu (Robert Moniot)
  1528. Date: 21 Oct 1996 19:57:22 GMT
  1529. Organization: Fordham University/FCLC
  1530.  
  1531. The Macintosh version of ftnchek 2.9.4 built by Michel Evrard is
  1532. available:
  1533.     ftp://ftp.dsm.fordham.edu/pub/ftnchek2.9/ftnchek294.mpw.hqx
  1534.  
  1535. I'll leave it to others to upload this to the usual Mac sites, since I
  1536. am not well acquainted with the Mac world.
  1537.  
  1538. The PostScript manual is in the same ftp directory, named
  1539. ftnchek-2.9.4.ps (uncompressed) and ftnchek-2.9.4.ps.gz (gzipped).
  1540.  
  1541. Reports of problems with this version should probably be sent to me
  1542. rather than Evrard.
  1543. --
  1544.  
  1545. Bob Moniot                          email:  moniot@mary.fordham.edu
  1546. Fordham University                        moniot@dsm.fordham.edu
  1547. Fordham College at Lincoln Center   URL:    http://www.dsm.fordham.edu/~moniot/
  1548. New York, NY  10023                 phone:  (212) 636-6311
  1549.  
  1550. +++++++++++++++++++++++++++
  1551.  
  1552. >From moniot@sobolev.dsm.fordham.edu (Robert Moniot)
  1553. Date: 23 Oct 1996 01:40:47 GMT
  1554. Organization: Fordham University/FCLC
  1555.  
  1556. The copy of the PostScript manual for ftnchek 2.9.4 that I placed on
  1557. our ftp server on Monday was corrupted.  The copy that is there now is
  1558. correct. Sorry for any inconvenience caused by this mistake.  The URL
  1559. for it is
  1560.        ftp://ftp.dsm.fordham.edu/pub/ftnchek2.9/ftnchek-2.9.4.ps
  1561.  
  1562. The manual included with the source code in ftnchek-2.9.4.tar.gz was
  1563. and is OK.
  1564. --
  1565.  
  1566. Bob Moniot                          email:  moniot@mary.fordham.edu
  1567. Fordham University                        moniot@dsm.fordham.edu
  1568. Fordham College at Lincoln Center   URL:    http://www.dsm.fordham.edu/~moniot/
  1569. New York, NY  10023                 phone:  (212) 636-6311
  1570.  
  1571. ---------------------------
  1572.  
  1573. >From winterp@spot.Colorado.EDU (WINTER  PAUL RUDOLPH)
  1574. Subject: GWorld problem
  1575. Date: 22 Oct 96 21:55:11 GMT
  1576. Organization: University of Colorado at Boulder
  1577.  
  1578. I noticed the tail of a thread on this topic, so I apologize for bringing
  1579. it up again, but...
  1580.  
  1581. I am having a problem with my GWorld. The program opens a window, creates
  1582. a GWorld, draws in the GWorld, and then opies the contents to the window.
  1583. The sequence of calls looks like this:
  1584.  
  1585. PlotWndw = GetNewWindow(WndwID,nil,-1)
  1586. call SetPort(PlotWndw)
  1587. myErr = NewGWorld(%ref(myFrame),0,wndwRect,nil,nil,pixPurge)
  1588. call GetGWorld(%ref(oldGWorld),%ref(oldDev))
  1589. call SetGWorld(myFrame,nil)
  1590. call EraseRect(myFrame.p^.portRect)
  1591.  
  1592. Plot the graph in the off-scren window
  1593.  
  1594. call SetGWorld(oldGWorld,oldDev)
  1595. call CopyBits(%ref(myFrame.p^.portPixMap.h^.p^),PlotWndw.p^.portBits,myFrame,p^.portRect,wndwRect,srcCopy,nil)
  1596. call SetPort(PlotWndw)
  1597.  
  1598. I don't dispose of the off-screen world because I use it for updating the
  1599. graph later on. I enter the above code listing at the call to GetGWorld, do
  1600. the updating (rescale the axis, highlight a peak, other things) where the 
  1601. graph is plotted, and then do the SetGWorld, CopyBits, etc.
  1602.  
  1603. The record myFrame is kept in memory after the GWorld is created until
  1604. the window is disposed.
  1605.  
  1606. I also access the off-screen world to update the window in response to an
  1607. update event:
  1608.  
  1609. call GetPort(%ref(oldPort))
  1610. WndwPtr.p = theEvent.message
  1611. if (WndwPtr.p.eq.PlotWndw.p) then
  1612.   call SetPort(wndwPtr)
  1613.   call BeginUpdate(WndwPtr)
  1614.   call CopyBits(%ref(myFrame.p^.portPixMap.h^.p^),wndwPtr.p^.portBits,myFrame.p^.portRect,wndwRect,srcCopy,nil)
  1615.   call DrawControls(WndwPtr)
  1616.   call EndUpdate(WndwPtr)
  1617.   call SetPort(oldPort)
  1618. end if
  1619.  
  1620. I do this same sequence for a different window in this program, and there is
  1621. never any problem. However, with my plot window, one of the options is to
  1622. save the data. I open the standard dialog window for entering a file, and
  1623. after I close it, the region of the plot window which was behind the dialog
  1624. box doesn't draw correctly. Instead, it comes out a spolthy purple-green-red
  1625. mix. But the program doesn't crash. However, if I try to use any controls
  1626. which force a redrawing of the window, the program freezes. The sequence of
  1627. events is this:
  1628.  
  1629. 1) Create PlotWndw and GWorld as above.
  1630. 2) Save the data, which sends the code through the Update loop.
  1631. 3) Try any action which forces a redraw of the window. The code executes:
  1632.    call GetGWorld(%ref(oldGWorld),%ref(oldDev))
  1633.    call SetGWorld(myFrame,nil)
  1634.    call EraseRect(myFrame.p^.portRect)
  1635. The code crashes on this call. I have checked the pointers to all the windows
  1636. etc;, they all seem to be fine. I have run the code so that it opens a
  1637. different dialog in front of the window; it runs fine on the redraw, although
  1638. it doesn't go through the Update loop first. I have opened th other window
  1639. (which goes through the same steps as this window), and it runs fine. And
  1640. the strangest part: when I do a dump of all variables (my compilier has a
  1641. call which does this), the problem goes away and the program doesn't crash.
  1642.  
  1643. Any thoughts? I'm working on stripping out all but the key calls so I can
  1644. try to isolate the key variables, but this could take time. Any help would
  1645. be greatly appreciated.
  1646.  
  1647. Thanks
  1648. Paul Winter
  1649.  
  1650.  
  1651. +++++++++++++++++++++++++++
  1652.  
  1653. >From jimmerkel@aol.com (Jim Merkel)
  1654. Date: 22 Oct 1996 22:09:06 -0400
  1655. Organization: America Online, Inc. (1-800-827-6364)
  1656.  
  1657. winterp@spot.Colorado.EDU (WINTER  PAUL RUDOLPH)
  1658. wrote:
  1659.  
  1660. [snip]
  1661. >The sequence of calls looks like this:
  1662.  
  1663. >PlotWndw = GetNewWindow(WndwID,nil,-1)
  1664. >call SetPort(PlotWndw)
  1665. >myErr = >NewGWorld(%ref(myFrame),0,wndwRect,nil,nil,pixPurge)
  1666. >call GetGWorld(%ref(oldGWorld),%ref(oldDev))
  1667. >call SetGWorld(myFrame,nil)
  1668. >call EraseRect(myFrame.p^.portRect)
  1669.  
  1670. >Plot the graph in the off-scren window
  1671.  
  1672. >call SetGWorld(oldGWorld,oldDev)
  1673. >call
  1674. >CopyBits(%ref(myFrame.p^.portPixMap.h^.p^),PlotWndw.p^.p>ortBits,myFrame,
  1675. p^.portRect,wndwRect,srcCopy,nil)
  1676. >call SetPort(PlotWndw)
  1677.  
  1678. If you are using GWorlds, you should not use GetPort() or SetPort() in
  1679. your code. Use GetGWorld() and SetGWorld() for both the GWorld and the
  1680. Window. Using SetPort() could be causing some of your problems
  1681.  
  1682. Jim Merkel 
  1683.  
  1684. +++++++++++++++++++++++++++
  1685.  
  1686. >From imp@iglou1.iglou.com (Indigo Moon Productions, Inc.)
  1687. Date: Thu, 24 Oct 1996 12:18:47 GMT
  1688. Organization: IgLou Internet Services (1-800-436-4456)
  1689.  
  1690. winterp@spot.Colorado.EDU (WINTER  PAUL RUDOLPH) writes:
  1691.  
  1692. >I noticed the tail of a thread on this topic, so I apologize for bringing
  1693. >it up again, but...
  1694.  
  1695.